import service from './request'
import { Message } from 'element-ui'
import store from '@/store'

function http(basicConfig, data) {
	let config = {
		url: basicConfig.url,
		method: basicConfig.method
	}
	if (data) {
		const type = config.method === 'post' ? 'data' : 'params'
	}
	return new Promise((resolve, reject) => {
		service(config).then(res => {
			resolve(res.data)
		}).catch(error => {
			reject(error)
		})
	})
}

export default http
